package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * StoreDelivery entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_STORE_DELIVERY", schema = "HCD_DEV")
public class StoreDelivery extends Entity implements java.io.Serializable {

	// Fields

	private StoreDeliveryId id;
	private Category category;
	private Store store;

	// Constructors

	/** default constructor */
	public StoreDelivery() {
	}

	/** full constructor */
	public StoreDelivery(StoreDeliveryId id, Category category, Store store) {
		this.id = id;
		this.category = category;
		this.store = store;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "storeId", column = @Column(name = "STORE_ID", nullable = false, precision = 15, scale = 0)),
			@AttributeOverride(name = "catId", column = @Column(name = "CAT_ID", nullable = false, precision = 15, scale = 0)) })
	public StoreDeliveryId getId() {
		return this.id;
	}

	public void setId(StoreDeliveryId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CAT_ID", nullable = false, insertable = false, updatable = false)
	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_ID", nullable = false, insertable = false, updatable = false)
	public Store getStore() {
		return this.store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

}